function getServiceCharge(price) {
  return Math.round(price * 0.006 * 100) / 100;
}

export function getOnlineWithReturnDiscount(goodsInfo) {
  const serviceCharge = getServiceCharge(goodsInfo.price);
  const l =
    (goodsInfo.price - goodsInfo.returnPrice - serviceCharge) / goodsInfo.price;
  console.log(l)
  const resL = Math.round(l * 100000) / 1000;
  return resL;
}

export function getOnlineNotWithReturnDiscount(goodsInfo) {
  const serviceCharge = getServiceCharge(goodsInfo.price);
  const l = (goodsInfo.price - serviceCharge) / goodsInfo.price;
  console.log(l)
  const resL = Math.round(l * 100000) / 1000;
  return resL;
}

export function getOfflineDiscount(goodsInfo) {
  const l = (goodsInfo.price - goodsInfo.returnPrice) / goodsInfo.price;
  const resL = Math.round(l * 100000) / 1000;
  return resL;
}
